/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.soccergamesarchive.persistencelayer.daos;

import cz.muni.fi.pa165.soccergamesarchive.persistencelayer.entities.Goal;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author tomas plevko
 */
@Local
public interface GoalDAO {

    /**
     * Insert new goal
     *
     * @param goal
     *
     * @throws IllegalArgumentException if goal doesn't exist or has incorrect
     *                                  record
     */
    public Goal addGoal(Goal goal) throws RuntimeException;

    /**
     * Altering of the existing goal record
     *
     * @param goal to be modified
     *
     * @return modified goal
     *
     * @throws IllegalArgumentException if goal doesn't exist, hasn't id or has
     *                                  incorrect record
     */
    public Goal changeGoal(Goal goal) throws RuntimeException;

    /**
     * delete existing goal record
     *
     * @param goal to be deleted
     *
     * @throws IllegalArgumentException if goal doesn't exist or hasn't id
     */
    public void deleteGoal(Goal goal) throws RuntimeException;

    /**
     * get all goal redords
     *
     * @return List of all goals
     *
     * @throws RuntimeException
     */
    public List<Goal> getAllGoals() throws RuntimeException;

    /**
     * get only some goals
     *
     * @param offset index of first record
     * @param limit  number of records that should be retrieved
     *
     * @return list of goals in the interval
     *
     * @throws IllegalArgumentException if offset or limit has incorrect value
     */
    public List<Goal> getLimitedNumberOfGoals(int offset, int limit) throws
            RuntimeException;

    /**
     * get goal by id
     *
     * @param id of the goal
     *
     * @return the goal
     *
     * @throws IllegalArgumentException if id has incorrect value
     */
    public Goal getGoalById(Long id) throws RuntimeException;

}
